package com.whd.demo;

import java.util.HashMap;
import java.util.Map;

/**
 * @author whd
 * @date 2023/07/25 21:19:38
 */
public class Demo2 {

    public static void main(String[] args) {

        for (long i = 1; i < 60; i++) {
            System.out.println(fbnq(i));
        }

    }

    static Map m = new HashMap<>();
    private static long fbnq(long n) {
        if (m.get(n) == null) {
            if (n == 1 || n == 2) {
                return 1;
            }
            long sum = fbnq(n - 2) + fbnq(n - 1);
            m.put(n, sum);
            return sum;
        }
        return (long) m.get(n);
    }
}
